package com.lin.vo;

import java.math.BigDecimal;

/**
 * CartItem购物项模型类
 *
 * @author manage
 */
public class CartItem {
    private Book book;
    private Integer count;    // 书本数量
    @SuppressWarnings("unused")
    private Double subtotal;// 书本小计

    public CartItem() {
        super();
    }

    public Book getBook() {
        return book;
    }

    public void setBook(Book book) {
        this.book = book;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Double getSubtotal() {
        // return count * book.getPrice();
        return new BigDecimal(count.toString()).multiply(new BigDecimal(book.getPrice().toString())).doubleValue();

    }

    public void setSubtotal(Double subtotal) {
        this.subtotal = subtotal;
    }

}
